package org.csu.gp_store.common;

import lombok.Getter;

@Getter
public enum FactoryStatus {
    regular("空闲中", 0),
    verifying("生产中", 1),
    freezing("无法接受生产任务", 2),
    canceled("已关闭", 3);

    private String description;
    private int index;

    FactoryStatus(String description, int index) {
        this.description = description;
        this.index = index;
    }

    public static String getDescription(int index) {
        for (FactoryStatus status : FactoryStatus.values()) {
            if (status.getIndex() == index) {
                return status.getDescription();
            }
        }
        return "error";
    }
}
